﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Diagnostics;

namespace StarfleetCommanderDomain.Game
{
    [DebuggerDisplay("\\{ Galaxy = {Galaxy}, GameSystem = {GameSystem}, Position = {Position}, IsMoon = {IsMoon} \\}")]
    public class Location
    {
        private readonly byte _Galaxy;
        private readonly short _GameSystem;
        private readonly byte _Position;
        private readonly bool _IsMoon;

        public Location(byte galaxy, short gameSystem, byte position, bool isMoon)
        {
            _Galaxy = galaxy;
            _GameSystem = gameSystem;
            _Position = position;
            _IsMoon = isMoon;
        }

       
        public override string ToString()
        {
            return String.Format("{{ Galaxy = {0}, GameSystem = {1}, Position = {2}, IsMoon = {3} }}", _Galaxy, _GameSystem, _Position, _IsMoon);
        }

        public byte Galaxy
        {
            get
            {
                return _Galaxy;
            }
        }
        public short GameSystem
        {
            get
            {
                return _GameSystem;
            }
        }
        public byte Position
        {
            get
            {
                return _Position;
            }
        }
        public bool IsMoon
        {
            get
            {
                return _IsMoon;
            }
        }

        public string GenerateId()
        {
            return Galaxy.ToString() + GameSystem.ToString() + Position.ToString() +( IsMoon ? "m" : string.Empty);
        }
    }
}